<html>
<body>
Reports unnecessary unary minuses. Such expressions might be hard to understand and might contain errors.
<p><b>For example:</b></p>
<pre><code>void unaryMinus(int i) {
    int x = - -i;
  }</code></pre>
<p>The following quick fixes are suggested here:</p>
<ul>
  <li><p>Remove <code>-</code> operators before the <code>i</code> variable:</p>
    <pre><code>void unaryMinus(int i) {
    int x = i;
  }</code></pre>
  </li>
  <li>
 <p>Replace <code>-</code> operators with the prefix decrement operator:</p>
    <pre><code>void unaryMinus(int i) {
    int x = --i;
  }</code></pre>
  </li>
</ul>

<p><b>Another example:</b></p>
<pre><code>void unaryMinus(int i) {
    i += - 8;
  }</code></pre>
<p>After the quick-fix is applied:</p>
<pre><code>void unaryMinus(int i) {
    i -= 8;
  }</code></pre>
<!-- tooltip end -->
</body>
</html>